﻿using Microsoft.Xna.Framework;

namespace RaptorEngine.Components
{
	public class ParticleComp : Component
	{
		// The type is used for the ParticleSprayer to know which particle to add.
		public string ParticleType { get; private set; }

		public ParticleComp(Entity entity, ComponentType type, string particleType)
			: base(entity, type)
		{
			ParticleType = particleType;
		}

		public void AddParticles(string particleType, Vector3 position, Vector3 velocity)
		{
			GameEngine.Instance.Render.ParticleSystems[particleType].AddParticle(position, velocity);
		}

		public void AddParticles(Vector3 position, Vector3 velocity)
		{
			AddParticles(ParticleType, position, velocity);
		}
	}
}
